package com.tledu.spring.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tledu.spring.domain.Role;import org.apache.ibatis.annotations.Param;import java.util.List;

/**
 * @author Lsj
 * @version 1.0
 * @date 2021/7/4 20:01
 */

public interface RoleMapper extends BaseMapper<Role> {
    /**
     * insert record to table
     *
     * @param record the record
     * @return insert count
     */
    int insert(Role record);

    /**
     * 查看role全部数据
     *
     * @param role role
     * @return 全部数据
     */
    List<Role> selectByAll(Role role);

    /**
     * 根据id查询
     *
     * @param r_id
     * @return
     */

    List<Role> selectAllByR_id(@Param("r_id") Integer r_id);

    /**
     * 更新
     *
     * @param updated
     * @param r_id
     * @return
     */
    int updateByR_id(@Param("updated") Role updated, @Param("r_id") Integer r_id);

    /**
     * 删除
     * @param r_id
     * @return
     */
    int deleteByR_id(@Param("r_id")Integer r_id);

    /**
     * 根据name查role
     * @param r_name
     * @return
     */
    Role selectAllByR_name(@Param("r_name")String r_name);
}